﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XmlSpecParser
{
	public static class XmlSerializer
	{
		public static void WriteToFile<T>(T data, string fileName)
		{
			System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(T));

			using (FileStream file = File.Open(fileName, FileMode.Create, FileAccess.Write))
			{
				serializer.Serialize(file, data);
			}
		}
	}
}
